package com.cyj.minio.service;

import com.cyj.minio.model.FileUploadRecord;
import org.springframework.web.multipart.MultipartFile;

/**
 * @Description: 文件管理服务层
 * @BelongsProject: SpringBoot-MinIO
 * @BelongsPackage: com.cyj.minio.service
 * @Author: ChenYongJia
 * @CreateTime: 2021-09-13 14:44
 * @Email: chen87647213@163.com
 * @Version: 1.0
 */
public interface FileManagementService {

    /**
     * 初始化文件
     *
     * @param md5
     * @param chunkCount
     * @param fileSize
     * @return
     */
    Object initChunkUpload(String md5, String chunkCount, String fileSize);

    /**
     * 合并文件
     *
     * @param md5
     * @param fileName
     * @return
     */
    Object composeFile(String md5, String fileName);

    /**
     * 鉴权桶上传
     *
     * @param file
     * @param fileName
     * @return
     */
    Object authUpload(MultipartFile file, String fileName);

    /**
     * 放行桶上传文件
     *
     * @param file
     * @return
     */
    Object allowUpload(MultipartFile file, String fileName);

    /**
     * 获取到图片的base64
     *
     * @param fileUploadRecord
     * @return
     */
    Object getPicBase64(FileUploadRecord fileUploadRecord);

}
